Chris Pollett >
Old Classses >
CS255 |
HW#3 --- last modified January 28 2019 19:26:59..Due date: Apr 4
Files to be submitted: Purpose: To gain experience with distributed algorithms Related Course Outcomes: The main course outcomes covered by this assignment are: CLO2 -- Analyze or code a parallel algorithm using a thread library CLO3 -- Analyze or code a parallel algorithm using a library such as OpenCL CLO4 -- Analyze the correctness and run time of a distributed algorithm Specification: This homework will consist of two parts, a written part and a coding part. Both parts will be submitted in the Hw3.zip file. The written part should be in a file Hw3.pdf. For the written part of the homework you should write solutions for the following questions. In what you turn in, make sure to write the names and student ids for each group member. For each problem, first copy and paste the question, then write your solution to it beneath it.
For the coding part of the assignment I would like to code a parallel algorithm for finding maximal cliques in a graph. Recall a clique is a set of vertices `C` in a graph `G`, such that for every `i, j in C`, the edge `{i,j}` is in `G`. Such a clique is maximal if it is not a proper subset of any other clique. Finding a clique is related to finding independents sets. Given a graph `G = (V, E)`, call `bar{G} = (V, \bar{E})`, where `bar{E} = \{(i,j) | (i,j) in V times V, (i,j) !in E\}`, the dual graph of `G`. A set is a clique in `G` if and only it is as an independent set in `bar{G}`. So I want you to modify parallel MIS from class to compute maximal cliques in parallel. Before you code anything, write up as part of Hw3.pdf, the pseudo code for your modification to ParallelMIS and briefly argue why it will correctly compute maximal cliques. Your program will be tested from the command line as follows: javac ParallelClique.java java ParallelClique graph_fileIf you want to use python, then name your file ParallelClique.py. Here graph_file will be a file containing the adjacency matrix of a graph you want to find a maximal clique for. This will be written as a series of rows of 1's and 0's separated by spaces, `(i,j)` is 1 if there is an edge shared by `i` and `j`. As the graph is undirected it is symmetric. For example, the graph, in this lecture slide would be expressed as: 0 1 0 1 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 1 0On such an input your program should output a maximal clique. In this case, the graph does not contain even a clique of size 3, so the maximal clique will be any pair of vertices that share an edge. For example, on the above input it might output: 3 5 Each vertex in the clique is listed on its own line from least to greatest. I subtracted 1 off each vertex name I used on the slide, so that indexes can agree with the default of arrays in Java and Python. Point Breakdown
|